package com.cotte.flow.repository;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

@Repository
public class SqlServerRepository {
	@Autowired
	@Qualifier("sqlserver")
	JdbcTemplate sqlserver;

	public Integer getOdid(String syscode, String cate) {
		String odidSql = "select odid from OrderDetail where syscode = '"
				+ syscode + "' and sort = '" + cate + "';";
		Map<String, Object> odidMap = sqlserver.queryForMap(odidSql);
		Integer odid = (int) odidMap.get("odid");
		return odid;
	}

}
